import mongoose from 'mongoose';

const TABLE_NAME = 'prePrintOrder';

function createdTime() {
    return +new Date();
}


const schema = new mongoose.Schema({
    createdTime: { type: Number, default: createdTime },
    updatedTime: { type: Number, default: createdTime },
    sys: { type: String },
    wid: { type: Number },
    tableId: { type: Number },
    tableNo: { type: String },
    opId: { type: String },
    foods: [{
        name: { type: String },
        num: { type: Number },
    }],
    total: { type: Number },
    actual: { type: Number },
    tokenKey: { type: String },
}, { versionKey: false, collection: TABLE_NAME });


export const model = mongoose.model(TABLE_NAME, schema);
